﻿package net.wangit.jdbc.transaction;

import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.transaction.TransactionManager;
/**
 * Orion事务类
 * 
 * @author watson
 * Feb 12, 2010
 */
public class OrionTransaction extends JTATransaction {

	public OrionTransaction() {
	}

	public TransactionManager getTransactionManager(InitialContext context)
			throws TransactionException {
		try {
			return (TransactionManager) context
					.lookup("java:comp/UserTransaction");
		} catch (NamingException ne) {
			throw new TransactionException(
					"Could not locate TransactionManager", ne);
		}
	}

	public String getUserTransactionName() {
		return "java:comp/UserTransaction";
	}
}
